package com.lnking.lnkingplace.model.dto.isolation.personnel;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.lnking.lnkingplace.Util.LocalDateTimeUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
public class PersonnelListDto {

    private String id;

    @ApiModelProperty("场所名称")
    private String placeName;

    @ApiModelProperty("隔离天数")
    private String isolationDay;

    @ApiModelProperty(value = "姓名")
    private String name;

    @ApiModelProperty(value = "性别")
    private String sex;

    @ApiModelProperty(value = "身份证号")
    private String idCard;

    @ApiModelProperty(value = "电话号码")
    private String phone;

    @ApiModelProperty(value = "年龄")
    private Integer age;

    @ApiModelProperty(value = "场所id")
    private String placeId;

    @ApiModelProperty(value = "房间号")
    private String roomNumber;

    @ApiModelProperty(value = "家庭地址")
    private String address;

    @ApiModelProperty(value = "解除隔离前往地址")
    private String moveAddress;

    @ApiModelProperty(value = "所属街道")
    private String street;

    @ApiModelProperty(value = "所属区域")
    private String area;

    @ApiModelProperty(value = "人员类型")
    private String personnelType;

    @ApiModelProperty(value = "备注")
    private String note;

    @ApiModelProperty(value = "来源地")
    private String source;

    @ApiModelProperty(value = "入住时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "解除隔离时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate endDate;

    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "搬离状态")
    private String moveStatus;

    @ApiModelProperty(value = "审核状态")
    private String auditStatus;

    @ApiModelProperty(value = "核酸轮次")
    private Integer round;

    @ApiModelProperty(value = "管控建议")
    private String controlProposal;

    @ApiModelProperty(value = "管控天数")
    private Integer controlDays;

    @ApiModelProperty(value = "所属社区")
    private String community;

    @ApiModelProperty(value = "重点人员")
    private String importantPersonnel;

    @JsonIgnore
    private String formatTime;


    public String getFormatTime(){
        return LocalDateTimeUtil.localDateTimeToString(createTime,"yyyy-MM-dd HH:mm:ss");
    }
}
